﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Aandelendelen.Obs;

namespace Aandelendelen.Controls
{
	[ToolboxData("<{0}:CurrencyLabel runat=server></{0}:CurrencyLabel>")]
	public class CurrencyLabel : Label
	{
		[Bindable(true)]
		[Category("Appearance")]
		[DefaultValue(0)]
		[Localizable(true)]
		public decimal Amount
		{
			get
			{
				decimal s = (decimal)ViewState["Amount"];
				return s;
			}

			set
			{
				ViewState["Amount"] = value;
				this.Text = ObjectFormatter.GetCurrencyString(value);
			}
		}
	}
}